Repository navigation
Fix crashes and data loss, add keyboard shortcuts and 3 themes; add tests + CI - #2
Merged
Merged
Conversation
Move JSON I/O and the settings/event/to-do sanitizers out of main.py into a pygame-free module so they can be unit tested without opening a window. main.py keeps thin wrappers bound to its live defaults. Bugs fixed along the way: - "Schedule for Tomorrow" set tag='tmr' and then deleted it on the next line, so tomorrow's to-dos had no tag and never rolled over to "today". - Date tags only rolled forward for top-level to-dos; anything filed inside a folder kept a stale "today" forever. - "Delete completed" ignored finished to-dos inside folders, and the button stayed disabled when only nested items were done. - Date tags were stored but never drawn. To-dos now show a small Today / Tomorrow / on <Weekday> pill, red when overdue. - Unreadable JSON (e.g. bad encoding) now falls back to defaults instead of raising UnicodeDecodeError at startup. Adds tests/test_store.py (26 tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158w81iQPwdBuV6B2KuQKPw
…he script main.spec builds a one-file executable, which unpacks itself into a temporary sys._MEIPASS folder that is deleted when the app exits. All user data (events, to-dos, settings, coins, Google OAuth token) was written through resource_path() into that folder, so the packaged app lost everything on every restart. - Bundled resources still come from the app root; writable data now goes to foci_store.user_data_dir(): FOCI_DATA_DIR if set, the platform data dir for packaged builds (%APPDATA%\Foci, ~/Library/Application Support/Foci, $XDG_DATA_HOME/Foci), and assets/ when running from source (unchanged for existing users). - resource_path() used the current working directory, so launching 'python path/to/main.py' from anywhere else couldn't find fonts, icons or the coin sprite sheet. It now resolves relative to the source file. - Call multiprocessing.freeze_support() so the lofi player subprocess doesn't re-launch the whole app in frozen Windows builds. - Name the built executable Foci.exe instead of main.exe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158w81iQPwdBuV6B2KuQKPw
- 'from google.auth_oauthlib.flow import ...' is not a real module (the package is google_auth_oauthlib), so google_calendar.py raised ImportError on import even with every dependency installed. - The day window was a naive local midnight with 'Z' appended, which asked Google for the UTC day instead of the user's day. It now sends local-offset RFC 3339 bounds. - Synced events took hour/minute in whatever offset Google returned; they are now converted to local time first. - All-day events were parsed as a 24h block at 00:00; they are skipped since the timeline has no all-day row yet. - Google libraries are now an optional import, so the module (and its conversion helpers) load without them. Adds tests/test_google_calendar.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158w81iQPwdBuV6B2KuQKPw
- Drop a one-line event_add_window() stub that was silently shadowed by the real definition further down. - format_time() used timedelta.seconds, which discards whole days, so durations of 24h+ wrapped around. Use the total seconds instead (utility.py and progress.py). - Remove unused imports (multiprocessing.Queue, gfxdraw, datetime). - Add pyproject.toml with pytest paths and a ruff config limited to real-bug checks (undefined names, redefinitions, syntax errors). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158w81iQPwdBuV6B2KuQKPw
…moke test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158w81iQPwdBuV6B2KuQKPw
- CONTRIBUTING.md: setup, FOCI_DATA_DIR for dev, project layout, how to run lint/tests, and guidelines. - CHANGELOG.md documenting the fixes on this branch. - Bug report and feature request issue forms, PR template. - README: CI badge, where data lives per platform, test instructions, mark Google Calendar sync as experimental, and stop claiming drag-to-reorder in the to-do list (it isn't implemented yet). - TECHNICAL.md: describe foci_store and the resource/data split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158w81iQPwdBuV6B2KuQKPw
akshit-python-programmer
marked this pull request as ready for review
November 15, 2026 05:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug fixes, two new features, and project setup. Each commit is self-contained and explains itself in its message.
New
?opens a help overlayCrashes and data loss fixed
y_offsetbefore assigning it, raisingUnboundLocalError.font_path, raisingNameError..exelost all user data on restart. It wrote into PyInstaller's temporary folder, which is deleted on exit. Data now goes to the OS app-data folder (assets/from source,FOCI_DATA_DIRto override).resource_path()depended on the current working directory, so assets went missing when the app was launched from another folder.Other fixes
google_auth_oauthlibimport was misspelled, so it always failedformat_timewrapped around at 24h+, unreadable JSON crashed startup, andfreeze_support()was missing for the lofi subprocess.Project setup
foci_store.py: persistence, validation and to-do navigation logic, with no pygame dependency.Testing
ruff check .andpytest -qpass locally (69 tests).dist/Foci.exeonce, adding an event, restarting, and confirming it's still there.🤖 Generated with Claude Code
https://claude.ai/code/session_0158w81iQPwdBuV6B2KuQKPw